﻿//-------------------------------------------------------------------------------------------------
// <copyright file="AbilityHandlers.cs" company="Anthony Adam">
// Copyright (c) Anthony Adam 2012. All rights reserved.
// </copyright>
//-------------------------------------------------------------------------------------------------
// ReSharper disable once CheckNamespace
namespace SuperStarRounds
{
  using System.Windows.Forms;

  /// <summary>
  /// Utility class containing the skill choice control population functions.
  /// </summary>
  public static class AbilityHandlers
  {
    /// <summary>
    /// Sets the current content selected in the application using the check marks
    /// on the select content check boxes tab.
    /// </summary>
    /// <param name="includeCore">true selects core rules content</param>
    /// <param name="includeAdvanced">true selects advanced players guide content</param>
    /// <param name="includeMagic">true selects ultimate magic content</param>
    /// <param name="includeCombat">true selects ultimate combat content</param>
    /// <param name="comboBox">The choice control to be populated</param>
    public static void SetAbilityList(bool includeCore, bool includeAdvanced, bool includeMagic, bool includeCombat, ComboBox comboBox)
    {
      comboBox.Items.Clear();

      // TODO: include other abilities

      AddAbility(includeCore, comboBox, "Charge");

      if (comboBox.Items.Count > 0)
        comboBox.SelectedIndex = 0;
      else
        comboBox.Text = string.Empty;
    }

    private static void AddAbility(bool addIt, ComboBox comboBox, string ability)
    {
      if (addIt)
      {
        comboBox.Items.Add(ability);
      }
    }
  }
}